package com.xmzs.system.domain.bo;

import com.xmzs.common.core.validate.AddGroup;
import com.xmzs.common.core.validate.EditGroup;
import com.xmzs.common.mybatis.core.domain.BaseEntity;
import com.xmzs.web.domain.ChatMessage;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

import java.math.BigDecimal;

/**
 * 聊天消息业务对象 chat_message
 *
 * @author Lion Li
 * @date 2023-11-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ChatMessage.class, reverseConvertGenerate = false)
public class ChatMessageBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 用户ID
     */
    @NotBlank(message = "用户ID", groups = { AddGroup.class, EditGroup.class })
    private Long UserId;

    /**
     * 消息 id
     */
    @NotBlank(message = "消息 id不能为空", groups = { AddGroup.class, EditGroup.class })
    private String messageId;

    /**
     * 父级消息 id
     */
    @NotBlank(message = "父级消息 id不能为空", groups = { AddGroup.class, EditGroup.class })
    private String parentMessageId;

    /**
     * 父级回答消息 id
     */
    @NotBlank(message = "父级回答消息 id不能为空", groups = { AddGroup.class, EditGroup.class })
    private String parentAnswerMessageId;

    /**
     * 父级问题消息 id
     */
    @NotBlank(message = "父级问题消息 id不能为空", groups = { AddGroup.class, EditGroup.class })
    private String parentQuestionMessageId;

    /**
     * 上下文数量
     */
    @NotNull(message = "上下文数量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long contextCount;

    /**
     * 问题上下文数量
     */
    @NotNull(message = "问题上下文数量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long questionContextCount;

    /**
     * 消息类型枚举
     */
    @NotNull(message = "消息类型枚举不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long messageType;

    /**
     * 聊天室 id
     */
    @NotNull(message = "聊天室 id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long chatRoomId;

    /**
     * 对话 id
     */
    @NotBlank(message = "对话 id不能为空", groups = { AddGroup.class, EditGroup.class })
    private String conversationId;

    /**
     * API 类型
     */
    @NotBlank(message = "API 类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String apiType;

    /**
     * ApiKey
     */
    @NotBlank(message = "ApiKey不能为空", groups = { AddGroup.class, EditGroup.class })
    private String apiKey;

    /**
     * 消息内容
     */
    @NotBlank(message = "消息内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String content;

    /**
     * 消息的原始请求或响应数据
     */
    @NotBlank(message = "消息的原始请求或响应数据不能为空", groups = { AddGroup.class, EditGroup.class })
    private String originalData;

    /**
     * 错误的响应数据
     */
    @NotBlank(message = "错误的响应数据不能为空", groups = { AddGroup.class, EditGroup.class })
    private String responseErrorData;

    /**
     * 输入消息的 tokens
     */
    @NotNull(message = "输入消息的 tokens不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long promptTokens;

    /**
     * 扣除费用
     */
    private BigDecimal deductCost;

    /**
     * 累计 Tokens
     */
    @NotNull(message = "累计 Tokens不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer totalTokens;

    /**
     * 模型名称
     */
    @NotBlank(message = "模型名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String modelName;



    /**
     * 聊天记录状态
     */
    @NotNull(message = "聊天记录状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long status;

    /**
     * 是否隐藏 0 否 1 是
     */
    @NotNull(message = "是否隐藏 0 否 1 是不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer isHide;

    /**
     * 备注
     */
    @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
    private String remark;


}
